﻿using System;
using RAP.Framework.Libary.DomTemplateBuilder.Attributes;
using RAP.Framework.Libary.DomTemplateBuilder.Handler.Cache;

namespace RAP.Framework.Libary.DomTemplateBuilder.Element.Cache
{
	/// <summary>
	/// CacheKey键节点
	/// </summary>
	[TagHandler( "Cache.CacheKey", typeof( CacheKeyHandler ) )]
	public class CacheKey : ElementBase
    {
		public override void Initialize ( System.Xml.XmlNode node )
		{
			CacheElementBase parentEle = this.Parent as CacheElementBase;
			if ( parentEle.CacheKey != null )
			{
				throw new Exception ( "任何条件节点只能包含一个CacheKey节点！" );
			}
			parentEle.CacheKey = this;
            base.Initialize( node );
		}
        
    }
}
